package com.idroc.coelacanth.service.servant;

import com.idroc.coelacanth.core.dht.ConsistendHashNode;
import com.idroc.coelacanth.core.membership.Endpoint;

public class HashStorageNode implements ConsistendHashNode {
	
	public static final int HASH_STORAGE_NODE = 1;
	
	private int no = -1;
	
	private int nodeType = HASH_STORAGE_NODE;
	
	private Endpoint endpoint = null;
	
	private ConsistendHashNode insertBackup = null;

	public HashStorageNode(int no, int type, Endpoint ep) {
	
		this.no = no;
		this.nodeType = type;
		this.endpoint = ep;
	}
	
	public HashStorageNode() { }

	public Endpoint getEndpoint() { 
		return this.endpoint;
	}

	public int getNo() {
		
		return this.no;
	}

	public int getNodeType() {
		return this.nodeType;
	}

	public void setEndpoint(Endpoint ep) {

		this.endpoint = ep;
	}

	public void setNo(int no) {

		this.no = no;
	}
	
	public ConsistendHashNode getInsertBackup() {
		return insertBackup;
	}

	public void setInsertBackup(ConsistendHashNode insertBackup) {
		this.insertBackup = insertBackup;
	}

}
